<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>

<head>

	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">

	<!-- Page title -->
	<title>中风医馆 | 登录</title>

	<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
	<!--<link rel="shortcut icon" type="image/ico" href="favicon.ico" />-->

	<!-- Vendor styles -->
	<link rel="stylesheet" href="/10.30/ThinkPHP/Application/Community/Public//vendor/fontawesome/css/font-awesome.css" />
	<link rel="stylesheet" href="/10.30/ThinkPHP/Application/Community/Public//vendor/metisMenu/dist/metisMenu.css" />
	<link rel="stylesheet" href="/10.30/ThinkPHP/Application/Community/Public//vendor/animate.css/animate.css" />
	<link rel="stylesheet" href="/10.30/ThinkPHP/Application/Community/Public//vendor/bootstrap/dist/css/bootstrap.css" />

	<!-- App styles -->
	<link rel="stylesheet" href="/10.30/ThinkPHP/Application/Community/Public//fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css" />
	<link rel="stylesheet" href="/10.30/ThinkPHP/Application/Community/Public//fonts/pe-icon-7-stroke/css/helper.css" />
	<link rel="stylesheet" href="/10.30/ThinkPHP/Application/Community/Public//styles/style.css">
	<style type="text/css">
		#surebtn {
			background-color: #bfbfbf;
			border-radius: 10px;
		}
		
		.get {
			font-size: 15px;
			color: #ffffff;
			margin: 0;
			padding: 7px;
			background-color: #5CB85C;
		}
	</style>

</head>

<body class="blank">

	<!-- Simple splash screen-->
	<div class="splash">
		<div class="color-line"></div>
		<div class="splash-title">
			<h1>Homer - Responsive Admin Theme</h1>
			<p>Special AngularJS Admin Theme for small and medium webapp with very clean and aesthetic style and feel. </p><img src="images/loading-bars.svg" width="64" height="64" /> </div>
	</div>
	<!--[if lt IE 7]>
<p class="alert alert-danger">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

	<div class="color-line"></div>

	<!--<div class="pull-left m">
    <a href="index.html" class="btn btn-primary">Back to Dashboard</a>
</div>-->

	<div class="login-container">
		<div class="row">
			<div class="col-md-12">
				<div class="text-center m-b-md">
					<h3>中风医馆</h3>
					<small>您的家庭医生</small>
				</div>
				<div class="hpanel">
					<div class="panel-body">
						<form action="#" id="loginForm">
							<div class="form-group;">
								<label class="control-label" for="phonenumber">手机号</label>
									<div>
									<input style="float:left;width: 285px;" type="text" placeholder="请输入您的手机号" id="phonenumber" class="form-control">
									<a id="surebtn" onclick="getcode()" style="float: right;">
										<p class="get">获取验证码</p>
									</a>
									</div>
										
							</div>
							<span class="help-block small">Your unique phonenumber to app</span>
							<div class="form-group">
								<label class="control-label" for="password">验证码</label>
								<div>
									<input  type="text" placeholder="请输入获取的验证码" id="password" class="form-control">
									
								</div>
							</div>
							<div class="checkbox" style="margin: 30px 0 0 0;">
								<input type="checkbox" class="i-checks" checked> 记住登录
								<p class="help-block small">(if this is a private computer)</p>
							</div>
							<button class="btn btn-success btn-block">登录</button>
						</form>
					</div>
				</div>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12 text-center">
				<strong>HOMER</strong> - AngularJS Responsive WebApp <br/> 2015 Copyright Company Name
			</div>
		</div>
	</div>

	<!-- Vendor scripts -->
	<script type="text/javascript">
		var nums = 60;

		function doLoop() {
			nums--;
			if(nums > 0) {
				$("#surebtn>p").text(nums + '秒后获取');
			} else {
				clearInterval(clock); //清除js定时器
				$("#surebtn>p").text("重新获取");
				$("#surebtn").removeAttr("disabled");
			}
		}
  
		function getcode() {
			var judge = checkphone();
			if(judge) {
				$("#surebtn").attr("disabled", "disabled");
				nums = 60;
				$("#surebtn>p").text(nums + '秒后获取');
				clock = setInterval(doLoop, 1000); //一秒执行一次
				var phonenumber = $("#phonenumber").val();		
				$.ajax({
					type: "post",
					url:"http://localhost/10.30/ThinkPHP/Community/Register/getphonecode",
					async: true,
					dataType: 'json',
					data: {
						"phonenumber": phonenumber
					},
					success: function(data) {

                        alert(JSON.stringify(data));
                        windows.location(data);
//                        if(data.code == "0")
//												    alert("手机号出错");
//												//alert(JSON.stringify(data));
					},
					error: function(xhr, type, errorThrown) {
						mui.toast("网络连接失败");
//						alert(JSON.stringify(type));
					}
				});
//                $.post("http://localhost/10.30/ThinkPHP/Community/Register/getphonecode",{phonenumber:phonenumber},function(data)
//                {
//                        alert("访问成功");
//                    $('#blank').html(data);
//                });

			}
		}

		function checkphone() {
			var mobile = $("#phonenumber").val();
			if(mobile.length == 0) {
				alert('请输入手机号码！');
				return false;
			}
			if(mobile.length != 11) {
				alert('请输入有效的手机号码！');
				return false;
			}

			//	var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
			//	if(!myreg.test(mobile)) {
			//		alert('请输入有效的手机号码！');
			//		document.form1.mobile.focus();
			//		return false;
			//	}
			return true;
		}
	</script>

	<script src="/10.30/ThinkPHP/Application/Community/Public//vendor/jquery/dist/jquery.min.js"></script>
	<script src="/10.30/ThinkPHP/Application/Community/Public//vendor/jquery-ui/jquery-ui.min.js"></script>
	<script src="/10.30/ThinkPHP/Application/Community/Public//vendor/slimScroll/jquery.slimscroll.min.js"></script>
	<script src="/10.30/ThinkPHP/Application/Community/Public//vendor/bootstrap/dist/js/bootstrap.min.js"></script>
	<script src="/10.30/ThinkPHP/Application/Community/Public//vendor/metisMenu/dist/metisMenu.min.js"></script>
	<script src="/10.30/ThinkPHP/Application/Community/Public//vendor/iCheck/icheck.min.js"></script>
	<script src="/10.30/ThinkPHP/Application/Community/Public//vendor/sparkline/index.js"></script>

	<!-- App scripts -->
	<script src="/10.30/ThinkPHP/Application/Community/Public//scripts/homer.js"></script>

	
</body>

</html>